package org.microframework.cloud.gateway.exception;

import org.springframework.http.HttpStatus;

/**
 * 路由未找到异常
 * 当请求的路由在网关中未定义时抛出
 */
public class RouteNotFoundException extends GatewayException {

	private static final long serialVersionUID = 1L;
	private static final String DEFAULT_MESSAGE = "未找到请求的服务路由";
    private static final int DEFAULT_ERROR_CODE = 503;

    public RouteNotFoundException() {
        super(HttpStatus.NOT_FOUND, DEFAULT_ERROR_CODE, DEFAULT_MESSAGE);
    }

    public RouteNotFoundException(String path) {
        super(HttpStatus.NOT_FOUND, DEFAULT_ERROR_CODE, "未找到路径[" + path + "]对应的服务路由");
    }

    public RouteNotFoundException(String message, Throwable cause) {
        super(HttpStatus.NOT_FOUND, DEFAULT_ERROR_CODE, message, cause);
    }
} 